import request from './request'

// 查询用户
export const getUser = (data) => {
  return request({
    url: '/user/userInfo/page',
    method: 'post',
    data: data
  })
}

// 修改用户状态
export const getUserState = (uId, type) => {
  return request({
    url: `/user/userInfo`,
    method: 'PUT',
    data: {id: uId, userStatus: type}
  })
}

// 添加用户
export const addUser = (data) => {
  return request({
    url: '/user/userInfo',
    method: 'post',
    data
  })
}

// 编辑用户
export const editUser = (data) => {
  return request({
    url: `/user/userInfo`,
    method: 'put',
    data
  })
}

// 删除用户
export const deleteUser = (id) => {
  return request({
    url: `/user/userInfo/${id}`,
    method: 'delete'
  })
}

// 修改用户岗位
export const updateUserJob = (data) => {
  return request({
    url: `/user/userInfo/updateUserJob`,
    method: 'post',
    data
  })
}

// 查询我的权限列表
export const getMyMenuList = () => {
  return request({
    url: '/user/userInfo/getMyMenuList'
  })
}